// eslint-disable-next-line
import { UserLayout, BasicLayout, BlankLayout } from '@/layouts'
import { bxAnaalyse } from '@/core/icons'

const RouteView = {
  name: 'RouteView',
  render: (h) => h('router-view')
}

export const asyncRouterMap = [

  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: 'menu.home' },
 
    children: [
      // dashboard
      {
        path: '/dashboard',
        name: 'homePage',
        component: () => import('@/views/index/index'),
        meta: { title: '首页', keepAlive: true, icon: 'profile', permission: [ 'index' ] },
        
      },
       {
        path: '/open',
        name: 'open',
        component: RouteView,
        meta: { title: '指标分析', icon: 'profile', permission: [ 'analysis' ] },
        children: [
          {
            path: '/analysisManage/index',
            name: 'openingIndex',
            hidden:true,
            component: () => import('@/views/analysisManage/index'),
            meta: { title: '开通首页', keepAlive: true, permission: [ 'analysis' ] }
          },
          {
            path: '/analysisManage/opening',///analysisManage/opening
            name: 'opening',
            component: () => import('@/views/analysisManage/opening/opening'),//@/views/analysisManage/opening/opening 原先路径
            meta: { title: '开通', keepAlive: true, permission: [ 'analysis' ] }
          },
          {
            path: '/analysisManage/breakdown',
            name: 'breakdown',
            component: () => import('@/views/analysisManage/breakdown/breakdown'),
            // 故障  （维护包括 故障 、投诉、 满意度）
            meta: { title: '维护', keepAlive: true, permission: [ 'analysis' ] }
          },
          {
            path: '/analysisManage/enterpriseWide',
            name: 'enterpriseWide',
            component: () => import('@/views/analysisManage/enterpriseWide/enterpriseWide'),
            // 故障  （维护包括 故障 、投诉、 满意度）
            meta: { title: '企宽', keepAlive: true, permission: [ 'analysis' ] }
          }
          ,
          {
            path: '/analysisManage/analysisReport',
            name: 'analysisReport',
            component: () => import('@/views/analysisManage/analysisReport'),
            meta: { title: '分析报表', keepAlive: true, permission: [ 'analysis' ] }
          },
          {
            path: '/analysisManage/analysisRecord',
            name: 'analysisRecord',
            component: () => import('@/views/analysisManage/analysisRecord'),
            meta: { title: '工单记录', keepAlive: true, permission: [ 'analysis' ] }
          },
         
         
        
        ]
      },
      
      {
        path: '/urge',
        name:'urge',
        component: RouteView,
        meta: { title: '催办管理', icon: 'profile', permission: [ 'urgeManage' ] },
        children:[
          {
            path: '/urgeManage/index',
            name: 'urgeIndex',
            hidden:true,
            component: () => import('@/views/UrgeManage/index'),
            meta: { title: '催办管理', keepAlive: true, permission: [ 'urgeManage' ] }
          },
          {
            path: '/urgeManage/urgeReport',
            name: 'urgeReport',
            component: () => import('@/views/UrgeManage/urgeReport'),
            meta: { title: '报表', keepAlive: true, permission: [ 'urgeManage' ] }
          }, 
          {
            path: '/urgeManage/urgeRecord',
            name: 'urgeRecord',
            component: () => import('@/views/UrgeManage/index'),
            meta: { title: '催办记录', keepAlive: true, permission: [ 'urgeManage' ] }
          },
        ]

      },  
      {
        path: '/account',
        name: 'account',
        component: () => import('@/views/accountManage/index'),
        meta: { title: '账户管理', icon: 'profile', permission: [ 'accountManage' ] },
        
      },

      {
        path: '/video',
        name: 'video',
        component: RouteView,
        meta: { title: '资源管理', icon: 'profile', permission: [ 'resourceManage' ] },
        // 视频监控管理
        children: [  
          {
            path: '/videoManagement',
            name: 'videoManagement',           
            component: RouteView,
            meta: { title: '视频管理', keepAlive: true, permission: [ 'resourceManage' ] },
            children:[
              {
                path: '/maintain',///analysisManage/opening
                name: 'maintain',
                component: RouteView,          
                meta: { title: '维护资源',  permission: [ 'resourceMangea' ] },
                children: [ 
                     
                  {
                    path: '/resources',///analysisManage/opening
                    name: 'resources',              
                    meta: { title: '资源入口', permission: [ 'resourceMangea' ] },
                    component: () => import('@/views/videoManage/maintenanceResources/resources/index'),            
                  },
                  {
                    path: '/resourceEntry',///analysisManage/opening
                    name: 'resourceEntry',
                    component: () => import('@/views/videoManage/maintenanceResources/resourceEntry/index'),          
                    meta: { title: '资源录入', permission: [ 'resourceMangea' ] },
                             
                  },
                  {
                    path: '/resourceStatistics',///analysisManage/opening
                    name: 'resourceStatistics',
                    component: RouteView,          
                    meta: { title: '资源统计', permission: [ 'resourceMangea' ] },
                    component: () => import('@/views/videoManage/maintenanceResources/resourceStatistics/index'),
                           
                  },
                ]
              },
    
              {
                path: '/resourcemanagement',
                name: 'resourcemanagement',
                component: RouteView,           
                meta: { title: '代维资源管理', keepAlive: true, permission: [ 'resourceMangeb' ]},
                children: [     
                  {
                    path: '/contractmanagement',///analysisManage/opening
                    name: 'contractmanagement',                        
                    meta: { title: '合同管理', permission: [ 'resourceMangeb' ] },
                    component: () => import('@/views/videoManage/resourceManagement/contractmanagement/index')
                                 
                  },
                  {
                    path: '/materialmanagement',///analysisManage/opening
                    name: 'materialmanagement',   
                    component: () => import('@/views/videoManage/resourceManagement/materialmanagement/statisticsmanagement/index'),                            
                    meta: { title: '物资管理', permission: [ 'resourceMangeb' ] },

                    // children: [     
                    //   {
                    //     path: '/newManagement',///analysisManage/opening
                    //     name: 'newManagement', 
                    //     component: () => import('@/views/videoManage/resourceManagement/materialmanagement/newmanagement/index'),    
                    //     meta: { title: '新增管理',  permission: [ 'resourceMangeb' ] },
                       
                    //   },
                    //   {
                    //     path: '/statisticsmanagement',///analysisManage/opening
                    //     name: 'statisticsmanagement',                      
                    //     meta: { title: '统计管理',  permission: [ 'resourceMangeb' ] }, 
                    //     component: () => import('@/views/videoManage/resourceManagement/materialmanagement/statisticsmanagement/index'),
                        
                    //   },
                    //    {
                    //     path: '/configurationsetting',///analysisManage/opening
                    //     name: 'configurationsetting', 
                    //     component: RouteView,         
                    //     meta: { title: '配置设置',  permission: [ 'resourceMangeb'] },
                    //     component: () => import('@/views/videoManage/resourceManagement/materialmanagement/configurationsetting/index'),
                        
                    //   },
                    // ]
                                 
                  },
    
    
    
    
    
                  
                ]
              }
              ,
              {
                path: '/InspectionManagement',
                name: 'InspectionManagement',
                component: RouteView,
                meta: { title: '巡检管理', keepAlive: true, permission: [ 'resourceMangec' ] },
                children: [     
                  {
                    path: '/inspectionReport',///analysisManage/opening
                    name: 'inspectionReport',   
                    component: () => import('@/views/videoManage/InspectionManagement/inspectionReport/index'),        
                    meta: { title: '巡检报告', permission: [ 'resourceMangec' ] },
                  
                                 
                  },
                  {
                    path: '/videoManage/InspectionManagement/inspectionStatisticst',///analysisManage/opening
                    name: 'inspectionStatisticst',   
                    component: () => import('@/views/videoManage/InspectionManagement/index'),        
                    meta: { title: '巡检统计', permission: [ 'resourceMangec' ] },
                  }  
                ]
              },
              
              {
                path: '/videoManage/costManagement/costManagement',
                name: 'costManagement',           
                component: () => import('@/views/videoManage/costManagement/index'),
                meta: { title: '费用管理', keepAlive: true, permission: [ 'resourceManged' ] }
              },
            ]
          },    
         
         
        
        ]
      },
      //xx管理
      // result
      {
        path: '/result',
        name: 'result',
        component: RouteView,
        
        meta: { title: '系统配置', icon: 'profile', permission: [ 'system' ] },
        children: [
          {
            path: '/systemManage/cycleIndex',
            name: 'cycleIndex',
            component: () => import('@/views/systemManage/cycleIndex'),
            meta: { title: '数据导入', keepAlive: true, permission: [ 'system' ] }
          },
          // {
          //   path: '/systemManage/cycReportConfig',
          //   name: 'cycReportConfig',
          //   component: () => import('@/views/systemManage/cycReportConfig'),
          //   meta: { title: '报表配置', keepAlive: true, permission: [ 'form' ] }
          // }
        ]     
      },
     
      // {
      //   path: '/regional',
      //   name: 'regional',
      //   component: () => import('@/views/regionalManage/index'),
      //   meta: { title: '区域情况', icon: 'profile', permission: [ 'form' ] },     
      // },
    ]
  },
  {
    path: '*', redirect: '/404', hidden: true
  }
]
/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [

 
  {
    path: '/userCenter',
    component: BasicLayout,
    redirect: '/userCenter',
    name: 'userCenter',
    hidden: true,
    children: [{
      path: '/userCenter',
      component: () => import('@/views/user/userCenter')
    }]
  },



  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }

]
